package com.qanda.tools;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class LocalDbHelper extends SQLiteOpenHelper {

	private static final String DATABASE_NAME="speedshop.db";
	private static final int DATABASE_VERSION=2;

	public LocalDbHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);	
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String sql="CREATE TABLE korisnik (id INTEGER NOT NULL, username TEXT NOT NULL, pass TEXT NOT NULL, uuid TEXT NOT NULL, infoVerzija INTEGER);";
		db.execSQL(sql);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS korisnik");
        onCreate(db);
	}	
	
}
